package com.yb.web.information.action;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.sf.json.JSONArray;

import com.opensymphony.xwork2.ActionContext;
import com.yb.base.web.BaseAction;
import com.yb.bussiness.global.SystemLogService;
import com.yb.bussiness.global.SystemLogServiceImpl;
import com.yb.bussiness.goods.CategoryService;
import com.yb.bussiness.goods.CategoryServiceImpl;
import com.yb.bussiness.goods.TrMessageCommendService;
import com.yb.bussiness.goods.TrMessageCommendServiceImpl;
import com.yb.bussiness.information.InformationService;
import com.yb.bussiness.information.InformationServiceImpl;
import com.yb.bussiness.shoper.BrandService;
import com.yb.bussiness.shoper.BrandServiceImpl;
import com.yb.bussiness.shoper.ShoperMessageService;
import com.yb.bussiness.shoper.ShoperMessageServiceImpl;
import com.yb.bussiness.statement.StatementService;
import com.yb.bussiness.statement.StatementServiceImpl;
import com.yb.domain.goods.ShoperMessage;
import com.yb.domain.goods.TgBrand;
import com.yb.domain.goods.TgCategory;
import com.yb.domain.goods.TgInformation;
import com.yb.domain.goods.TgInformationFormBean;
import com.yb.domain.goods.TgType;
import com.yb.domain.goods.TpGongLue;
import com.yb.domain.goods.TrMessageCommend;
import com.yb.domain.member.TsSysuser;
import com.yb.util.comm.Contants;
import com.yb.util.comm.DateTimeUtil;
import com.yb.util.comm.RequestUtil;
import com.yb.util.file.FileUtil;
import com.yb.util.file.ImageSizer;
import com.yb.util.file.XmlUtil;
import com.yb.util.framework.PageUtil;

/**
 * 资讯相关Action
 * 
 * @author SFF
 * 
 */
public class InformationAction extends BaseAction {
    
    private static final long serialVersionUID = 688970037309060648L;
    
    private int total;
    
    private TgInformation tgInformation;
    
    private List rows;
    
    private List<TgCategory> catrows;
    
    private List<TgCategory> pcatrows;
    
    private int flag;
    
    // 1热门活动2全站热点3行业资讯4品牌种类资讯5提取资讯6图文资讯
    private int type;
    
    private int oldtype;
    
    private File imageFile;
    
    private String imageFileFileName;
    
    private InformationService service;
    
    private CategoryService catsrvice;
    
    private long catid;
    
    private ShoperMessageService shoperMessgaeservice;
    
    private ShoperMessage shopmessage;
    
    private int pcatid;
    
    private BrandService brandService;
    
    private List<TgType> typeList;
    
    private List<TgCategory> catList;
    
    private String hotActivity;
    
    private int pageNo;
    
    private int limit;
    
    private int categoryId;
    
    private String categoryname;
    
    private TrMessageCommendService tmcService;
    
    private SystemLogService systemLogService;
    
    private StatementService statementservice;
    
    private TgInformation tgInformationimg;
    
    public InformationAction() {
        service = new InformationServiceImpl();
        catsrvice = new CategoryServiceImpl();
        brandService = new BrandServiceImpl();
        shoperMessgaeservice = new ShoperMessageServiceImpl();
        tmcService = new TrMessageCommendServiceImpl();
        systemLogService = new SystemLogServiceImpl();
        statementservice = new StatementServiceImpl();
    }
    
    /*
     * 转向管理页面
     */
    @SuppressWarnings("unchecked")
    public String toInformationManage() {
        catrows = catsrvice.findAll(1, 50);
        if (type == 1) {
            return "hotActivitiesManage";
        }
        if (type == 2) {
            return "hotinformation";
        }
        if (type == 3) {
            return "industryinformation";
        }
        if (type == 4) {
            return "categoryinformation";
        }
        if (type == 5) {
            return "extractioninfo";
        }
        if (type == 6) {
            return "imginfo";
        }
        else {
            return "informationManage";
        }
    }
    
    public String getInformationManage() {
        try {
            String page = RequestUtil.getParam(request, "page", "1");
            String row = RequestUtil.getParam(request, "rows", "10");
            String title = RequestUtil.getParam(request, "title", "");
            String startTime = RequestUtil.getParam(request, "startTime", "");
            String endTime = RequestUtil.getParam(request, "endTime", "");
            String hotFlag = RequestUtil.getParam(request, "hotFlag", "");
            String pcategoryId = RequestUtil.getParam(request, "pcategoryId", "");
            String categoryId = RequestUtil.getParam(request, "categoryId", "");
            String imgFlag = RequestUtil.getParam(request, "imgFlag", "");
            String hotActivities = RequestUtil.getParam(request, "hotActivities", "");
            String isRecommend = RequestUtil.getParam(request, "isRecommend", "");
            TgInformationFormBean formBean = new TgInformationFormBean();
            formBean.setCategoryId(categoryId);
            formBean.setEndTime(endTime);
            formBean.setHotFlag(hotFlag);
            formBean.setStartTime(startTime);
            formBean.setTitle(title.trim());
            formBean.setPcategoryId(pcategoryId);
            formBean.setImgFlag(imgFlag);
            formBean.setHotActivities(hotActivities);
            formBean.setIsRecommend(isRecommend);
            formBean.setType(type);
            Map<String, Object> map = service.findAll(formBean, page, row);
            rows = (List<TgInformation>)map.get("list");
            total = Integer.parseInt(map.get("total").toString());
        }
        catch (Exception e) {
            log.error("资讯管理信息出错", e);
        }
        return Contants.JSONSTRING_RESULT_NAME;
    }
    
    /**
     * 前台资讯详情页
     * 
     * @return
     */
    public String searchPingGouAndBrand() {
        try {
            List<TgBrand> list = brandService.findAllBrand();
            ActionContext context = ActionContext.getContext();
            context.put("tglist", list);
            String id = RequestUtil.getParam(request, "id", "");
            TgInformation information = service.read(Long.parseLong(id));
            information.setCreatTimeStr(DateTimeUtil.switchDateToString(information.getCreateDate(),
            "yyyy-MM-dd HH:mm:ss"));
            ActionContext.getContext().put("information", information);
            if (information.getPcategoryId() != null && information.getPcategoryId() != 0) {
                categoryname = catsrvice.findById(new Long(information.getPcategoryId())).getName();
            }
            else {
                categoryname = "";
            }
            tgInformationimg =   service.readBycategoryFlag(7);
        }
        catch (Exception e) {
            log.error("查询资讯信息出错", e);
        }
        return "showzixun";
    }
    
    public String saveOrUpdate() {
        try {
            if(null == tgInformation)
            	tgInformation = new TgInformation();
            tgInformation.setCreateDate(new Date());
            if (tgInformation.getImgFlag() == null)
                tgInformation.setImgFlag("2");
            if (tgInformation.getHot() == null)
                tgInformation.setHot("2");
            // 删除回车
            tgInformation.setTitle(tgInformation.getTitle().replace("<p>", "").replace("</p>", ""));
            TsSysuser tsSysuser = (TsSysuser) RequestUtil.getLoginUserFromSession(request, Contants.SESSION_USER);
            if(tsSysuser!=null&&!"ybtest".equals(tsSysuser.getUsername())){
               tgInformation.setCreator(tsSysuser.getUsername());
            }
            if(tgInformation.getMessageId()!=null&&tgInformation.getMessageId()!=0){
                tgInformation.setIsRecommend(1);
            shopmessage = shoperMessgaeservice.findById(tgInformation.getMessageId()+"");
            shopmessage.setRecommend("1");
            shoperMessgaeservice.isSaveOrUpdate(shopmessage);
            }
            service.saveOrUpdate(tgInformation);
           
            catrows = catsrvice.findAll(1, 50);
        }
        catch (Exception e) {
            log.error("保存或修改信息出错", e);
        }
        if (type == 1) {
            if(tgInformation.getId()==null){
               systemLogService.saveSystemLog(request, "热门活动", "新增--"+tgInformation.getTitle());
            }else{
               systemLogService.saveSystemLog(request, "热门活动", "修改--"+tgInformation.getTitle());
            }
            tgInformation = null;
            return "hotActivitiesManage";
        }
        if (type == 2) {
            if(tgInformation.getId()==null){
                systemLogService.saveSystemLog(request, "全站热点", "新增--"+tgInformation.getTitle());
             }else{
                systemLogService.saveSystemLog(request, "全站热点", "修改--"+tgInformation.getTitle());
             }
            tgInformation = null;
            return "hotinformation";
        }
        if (type == 3) {
            if(tgInformation.getId()==null){
                systemLogService.saveSystemLog(request, "行业资讯", "新增--"+tgInformation.getTitle());
             }else{
                systemLogService.saveSystemLog(request, "行业资讯", "修改--"+tgInformation.getTitle());
             }
            tgInformation = null;
            return "industryinformation";
        }
        if (type == 4) {
            if(tgInformation.getId()==null){
                systemLogService.saveSystemLog(request, "品牌种类资讯", "新增--"+tgInformation.getTitle());
             }else{
                systemLogService.saveSystemLog(request, "品牌种类资讯", "修改--"+tgInformation.getTitle());
             }
            tgInformation = null;
            return "categoryinformation";
        }
        if (type == 6) {
            if(tgInformation.getId()==null){
                systemLogService.saveSystemLog(request, "图文资讯", "新增--"+tgInformation.getTitle());
             }else{
                systemLogService.saveSystemLog(request, "图文资讯", "修改--"+tgInformation.getTitle());
             }
            tgInformation = null;
            return "imginformation";
        }
        if (type == 7) {
            systemLogService.saveSystemLog(request, "资讯广告", "修改--" + tgInformation.getTitle());
            tgInformation = null;
            return "imginformation";
        }
        if (type == 8) {
            systemLogService.saveSystemLog(request, "引导页广告", "修改--" + tgInformation.getTitle());
            tgInformation = null;
            return "imginformation";
        }
        if (type == 9) {
            systemLogService.saveSystemLog(request, "引导页广告", "修改--" + tgInformation.getTitle());
            tgInformation = null;
            return "imginformation";
        }
        else {
            return "informationManage";
        }
        
    }
    
    public String recommend() {
        try {
            tgInformation.setCreateDate(new Date());
            // tgInformation.getTitle()保存了商家信息id
            if (tgInformation.getTitle() == null)
                tgInformation.setTitle("0");
            shopmessage = shoperMessgaeservice.findById(tgInformation.getTitle());
            tgInformation.setMessageId(new Integer(tgInformation.getTitle()));
            tgInformation.setIsRecommend(1);
            tgInformation.setTitle(shopmessage.getTitle());
            tgInformation.setContent(shopmessage.getContent());
            if ("3".equals(tgInformation.getHot())) {
                tgInformation.setHotActivities("1");
            }
            else {
                tgInformation.setHotActivities("2");
            }
            if (tgInformation.getImgFlag() == null)
                tgInformation.setImgFlag("2");
            String basePath = request.getSession().getServletContext().getRealPath("/");
            String compressPath = XmlUtil.getValue("imgPath", "sysConfig") + "/";
            String fileName = "";
            if (imageFile != null) {
                fileName = new Date().getTime() + imageFileFileName.substring(imageFileFileName.lastIndexOf("."));
                if (FileUtil.doUpFile(basePath + compressPath + fileName, imageFile)) {
                    tgInformation.setImgUrl(compressPath + fileName);
                }
            }
            
            service.saveOrUpdate(tgInformation);
            shopmessage.setRecommend("1");
            shoperMessgaeservice.isSaveOrUpdate(shopmessage);
            response.getWriter().print("<script>parent.recommend();</script>");
        }
        catch (Exception e) {
            log.error("首页推荐信息信息出错", e);
        }
        return null;
    }
    
    public String recommend1() {
        try {
            tgInformation.setCreateDate(new Date());
            // tgInformation.getTitle()保存了商家信息id
            shopmessage = shoperMessgaeservice.findById(tgInformation.getTitle());
            tgInformation.setTitle(shopmessage.getTitle());
            tgInformation.setContent(shopmessage.getContent());
            if ("3".equals(tgInformation.getHot())) {
                tgInformation.setHotActivities("1");
            }
            else {
                tgInformation.setHotActivities("2");
            }
            if (tgInformation.getImgFlag() == null)
                tgInformation.setImgFlag("2");
            String basePath = request.getSession().getServletContext().getRealPath("/");
            String compressPath = XmlUtil.getValue("imgPath", "sysConfig") + "/";
            String fileName = "";
            if (imageFile != null) {
                fileName = new Date().getTime() + imageFileFileName.substring(imageFileFileName.lastIndexOf("."));
                if (FileUtil.doUpFile(basePath + compressPath + fileName, imageFile)) {
                    tgInformation.setImgUrl(compressPath + fileName);
                }
            }
            
            service.saveOrUpdate(tgInformation);
            TrMessageCommend tmc = new TrMessageCommend();
            tmc.setMessageId(shopmessage.getId());
            tmcService.delete(tmc);
            shopmessage.setRecommend("1");
            shoperMessgaeservice.isSaveOrUpdate(shopmessage);
            response.getWriter().print("<script>parent.recommend();</script>");
        }
        catch (Exception e) {
            log.error("首页推荐信息信息出错", e);
        }
        return null;
    }
    
    public String delete() {
        String id = RequestUtil.getParam(request, "id", "");
        String idString = RequestUtil.getParam(request, "idString", "");
        tgInformation = service.read(new Long(id));
        boolean isFlag = false;
        if (!"".equals(id))
            isFlag = service.deleteByIdString(id);
        else
            isFlag = service.deleteByIdString(idString);
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = null;
        if (isFlag)
            message = "删除成功";
        else
            message = "删除失败";
        StringBuffer sb = new StringBuffer("[");
        sb.append("{\"message\":\"" + message + "\"" + "}");
        sb.append("]");
        
        try {
            out = response.getWriter();
            out.println(sb.toString());
        }
        catch (IOException e) {
            log.error("删除信息出错", e);
        }
        
        if (type == 1) {
            systemLogService.saveSystemLog(request, "热门活动", "删除--"+tgInformation.getTitle());
            tgInformation = null;
        }
        if (type == 2) {
            systemLogService.saveSystemLog(request, "全站热点", "删除--"+tgInformation.getTitle());
            tgInformation = null;
        }
        if (type == 3) {
            systemLogService.saveSystemLog(request, "行业资讯", "删除--"+tgInformation.getTitle());
            tgInformation = null;
        }
        if (type == 4) {
            systemLogService.saveSystemLog(request, "品牌种类资讯", "删除--"+tgInformation.getTitle());
            tgInformation = null;
        }
        if (type == 6) {
            systemLogService.saveSystemLog(request, "图文资讯", "删除--"+tgInformation.getTitle());
            tgInformation = null;
        }
        
        
        return null;
    }
    
    /*
     * 跳转信息页面
     */
    public String totuijianInfo() {
        try {
            String id = RequestUtil.getParam(request, "id", "");
            if (!"".equals(id)) {
                tgInformation = service.readByMessId(id);
                tgInformation.setCreatTimeStr(DateTimeUtil.switchDateToString(tgInformation.getCreateDate(),
                    "yyyy-MM-dd HH:mm:ss"));
            }
            if (!"1".equals(tgInformation.getHotActivities())) {
                List<TgCategory> cList = new ArrayList();
                List<TgCategory> pList = catsrvice.findAll(1, 50);
                if (tgInformation != null) {
                    TgCategory tc = catsrvice.findById(new Long(tgInformation.getCategoryId()));
                    if (tc != null) {
                        cList = catsrvice.findByPid(new Long(tc.getPid()), -1, -1);
                    }
                    ActionContext.getContext().put("pid", tgInformation.getPcategoryId());
                    ActionContext.getContext().put("cid", tgInformation.getCategoryId());
                }
                else {
                    ActionContext.getContext().put("pid", "0");
                    ActionContext.getContext().put("cid", "0");
                }
                ActionContext.getContext().put("pList", pList);
                ActionContext.getContext().put("cList", cList);
                ActionContext.getContext().put("bid", id);
                
                catrows = catsrvice.findAll(1, 50);
            }
        }
        catch (Exception e) {
            log.error("查询信息出错", e);
        }
        if ("1".equals(tgInformation.getHotActivities())) {
            return "tohotActivitiesInfo";
        }
        else {
            return "toInformationInfo";
        }
        
    }
    
    /*
     * 跳转推荐信息页面
     */
    public String toInformationInfo() {
        try {
            long id = RequestUtil.getParam(request, "id", 0l);
            if (id != 0) {
                tgInformation = service.read(id);
                tgInformation.setCreatTimeStr(DateTimeUtil.switchDateToString(tgInformation.getCreateDate(),
                    "yyyy-MM-dd HH:mm:ss"));
            }
            if (type == 7||type == 8||type == 9) {
                tgInformation = service.readBycategoryFlag(type);
                tgInformation.setCategoryFlag(type);
                return "toinfoimg";
            }
            if (type != 1) {
                List<TgCategory> cList = new ArrayList();
                List<TgCategory> pList = catsrvice.findAll(1, 50);
                if (tgInformation != null) {
                    TgCategory tc = catsrvice.findById(new Long(tgInformation.getCategoryId()));
                    if (tc != null) {
                        cList = catsrvice.findByPid(new Long(tc.getPid()), -1, -1);
                    }
                    ActionContext.getContext().put("pid", tgInformation.getPcategoryId());
                    ActionContext.getContext().put("cid", tgInformation.getCategoryId());
                }
                else {
                    ActionContext.getContext().put("pid", "0");
                    ActionContext.getContext().put("cid", "0");
                }
                ActionContext.getContext().put("pList", pList);
                ActionContext.getContext().put("cList", cList);
                ActionContext.getContext().put("bid", id);
                
                catrows = catsrvice.findAll(1, 50);
            }
        }
        catch (Exception e) {
            log.error("查询信息出错", e);
        }
        
        if (type == 1) {
            return "tohotActivitiesInfo";
        }
        if (type == 2) {
            return "tohotinfo";
        }
        if (type == 3) {
            return "toindustryinfo";
        }
        if (type == 4) {
            return "tocategoryinfo";
        }
        if (type == 6) {
            return "toimginfo";
        }
        else {
            return "toInformationInfo";
        }
        
    }
    
    /**
     * 上传图片
     * 
     * @return
     */
    public String preview() {
        try {
            int height = 210;
            int width = 315;
            if ("1".equals(hotActivity)) {
                height = 202;
                width = 644;
            }
            
            if (null != imageFile) {
                String basePath = getBasePath();
                String fileName =
                    new Date().getTime()
                        + imageFileFileName.substring(imageFileFileName.indexOf("."), imageFileFileName.length());
                String imgPath = XmlUtil.getValue("imgPath", "sysConfig");
                String informationImgPath = "/" + imgPath + "/";
                
                if("9".equals(hotActivity)){
                 FileUtil .doUpFile(basePath + informationImgPath + fileName, imageFile);
                }else{
                 ImageSizer.doCompress(imageFile, basePath + informationImgPath + fileName, width, height, 1.0f, true);
                }
                response.getWriter().print("<script>parent.showimg('" + informationImgPath
                    + java.net.URLEncoder.encode(fileName, "UTF-8") + "','" + imgPath + "/"
                    + java.net.URLEncoder.encode(fileName, "UTF-8") + "')</script>");
                
            }
        }
        catch (Exception e) {
            log.error("图片预览错误", e);
        }
        return null;
    }
    
    public String moreInformation() {
        if (pageNo == 0)
            pageNo = 1;
        if (limit == 0)
            limit = 20;
        ActionContext context = ActionContext.getContext();
        PageUtil informationlist = service.findByCategoryId(new Long(categoryId), pageNo, limit);
        context.put("informationlist", informationlist);
        categoryname = catsrvice.findById(new Long(categoryId)).getName();
        return "toMoreInformationlist";
    }
    
    public String findAllInformation() {
        try {
            if (pageNo == 0)
                pageNo = 1;
            if (limit == 0)
                limit = 20;
            Long categoryId = RequestUtil.getParam(request, "categoryId", 0l);
            List<TgInformation> list = service.findByCategoryTask(categoryId, (pageNo - 1) * limit, limit);
            response.getWriter().print(JSONArray.fromObject(list));
        }
        catch (Exception e) {
            log.error("根据行业获取资讯信息", e);
        }
        return null;
    }
    
    public String findAllInformationTask() {
        try {
            if (pageNo == 0)
                pageNo = 1;
            if (limit == 0)
                limit = 20;
            Long categoryId = RequestUtil.getParam(request, "categoryId", 0l);
            List<TgInformation> list = service.findByCategory(categoryId, (pageNo - 1) * limit, limit);
            response.getWriter().print(JSONArray.fromObject(list));
        }
        catch (Exception e) {
            log.error("根据行业获取资讯信息", e);
        }
        return null;
    }
    
    public String findAllInformationChild() {
        try {
            if (pageNo == 0)
                pageNo = 1;
            if (limit == 0)
                limit = 20;
            Long categoryId = RequestUtil.getParam(request, "categoryId", 0l);
            List<TgInformation> list = service.findByCategoryChild2(categoryId, (pageNo - 1) * limit, limit);
            response.getWriter().print(JSONArray.fromObject(list));
        }
        catch (Exception e) {
            log.error("根据行业获取资讯信息", e);
        }
        return null;
    }
    
    
    
    
    public String modifyWeights() {
        try {
            Long infoId = RequestUtil.getParam(request, "infoId", 0l);
            int weights = RequestUtil.getParam(request, "weights", 0);
            service.modifyGoodsWeight(infoId, weights);
            response.getWriter().print("1");
        } catch (Exception e) {
            log.error("修改资讯权重失败", e);
            try {
                response.getWriter().print("2");
            } catch (IOException e1) {
                log.error("修改资讯权重失败", e1);
            }
        }
        return null;
    }
    
    private String informationImg(){
        
        return null;
    }
    
    
    /**
     * 获取系统路径
     * 
     * @return
     */
    private String getBasePath() {
        return request.getSession().getServletContext().getRealPath("");
    }
    
    public int getTotal() {
        return total;
    }
    
    public void setTotal(int total) {
        this.total = total;
    }
    
    public List getRows() {
        return rows;
    }
    
    public void setRows(List rows) {
        this.rows = rows;
    }
    
    public int getFlag() {
        return flag;
    }
    
    public void setFlag(int flag) {
        this.flag = flag;
    }
    
    public File getImageFile() {
        return imageFile;
    }
    
    public void setImageFile(File imageFile) {
        this.imageFile = imageFile;
    }
    
    public String getImageFileFileName() {
        return imageFileFileName;
    }
    
    public void setImageFileFileName(String imageFileFileName) {
        this.imageFileFileName = imageFileFileName;
    }
    
    public TgInformation getTgInformation() {
        return tgInformation;
    }
    
    public void setTgInformation(TgInformation tgInformation) {
        this.tgInformation = tgInformation;
    }
    
    public InformationService getService() {
        return service;
    }
    
    public void setService(InformationService service) {
        this.service = service;
    }
    
    public CategoryService getCatsrvice() {
        return catsrvice;
    }
    
    public void setCatsrvice(CategoryService catsrvice) {
        this.catsrvice = catsrvice;
    }
    
    public List<TgType> getTypeList() {
        return typeList;
    }
    
    public void setTypeList(List<TgType> typeList) {
        this.typeList = typeList;
    }
    
    public List<TgCategory> getCatList() {
        return catList;
    }
    
    public void setCatList(List<TgCategory> catList) {
        this.catList = catList;
    }
    
    public String getHotActivity() {
        return hotActivity;
    }
    
    public void setHotActivity(String hotActivity) {
        this.hotActivity = hotActivity;
    }
    
    public int getType() {
        return type;
    }
    
    public void setType(int type) {
        this.type = type;
    }
    
    public List<TgCategory> getCatrows() {
        return catrows;
    }
    
    public void setCatrows(List<TgCategory> catrows) {
        this.catrows = catrows;
    }
    
    public long getCatid() {
        return catid;
    }
    
    public void setCatid(long catid) {
        this.catid = catid;
    }
    
    public int getPcatid() {
        return pcatid;
    }
    
    public void setPcatid(int pcatid) {
        this.pcatid = pcatid;
    }
    
    public List<TgCategory> getPcatrows() {
        return pcatrows;
    }
    
    public void setPcatrows(List<TgCategory> pcatrows) {
        this.pcatrows = pcatrows;
    }
    
    public int getPageNo() {
        return pageNo;
    }
    
    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }
    
    public int getLimit() {
        return limit;
    }
    
    public void setLimit(int limit) {
        this.limit = limit;
    }
    
    public int getCategoryId() {
        return categoryId;
    }
    
    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }
    
    public String getCategoryname() {
        return categoryname;
    }
    
    public void setCategoryname(String categoryname) {
        this.categoryname = categoryname;
    }
    
    public ShoperMessage getShopmessage() {
        return shopmessage;
    }
    
    public void setShopmessage(ShoperMessage shopmessage) {
        this.shopmessage = shopmessage;
    }
    
    public int getOldtype() {
        return oldtype;
    }
    
    public void setOldtype(int oldtype) {
        this.oldtype = oldtype;
    }

    public TgInformation getTgInformationimg() {
        return tgInformationimg;
    }

    public void setTgInformationimg(TgInformation tgInformationimg) {
        this.tgInformationimg = tgInformationimg;
    }

   
    
    
    
}
